package com.mfw.springboot.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mfw.springboot.common.DataGroupByDateDTO;
import com.mfw.springboot.model.dto.userClassRelation.UserClassRelationQueryRequest;
import com.mfw.springboot.model.entity.UserClassRelation;
import com.mfw.springboot.model.vo.UserClassRelationVO;

import javax.servlet.http.HttpServletRequest;

import java.util.Date;
import java.util.List;

/**
 * 用户班级关系服务
 *
 * @author mfw
 * @from <a href="https://gitee.com/hanhuaifei/projects">我的gitee</a>
 * @Date 2024/9/26
 */
public interface UserClassRelationService extends IService<UserClassRelation> {

    /**
     * 校验数据
     *
     * @param userClassRelation
     * @param add 对创建的数据进行校验
     */
    void validUserClassRelation(UserClassRelation userClassRelation, boolean add);

    /**
     * 获取查询条件
     *
     * @param userClassRelationQueryRequest
     * @return
     */
    QueryWrapper<UserClassRelation> getQueryWrapper(UserClassRelationQueryRequest userClassRelationQueryRequest);
    
    /**
     * 获取用户班级关系封装
     *
     * @param userClassRelation
     * @param request
     * @return
     */
    UserClassRelationVO getUserClassRelationVO(UserClassRelation userClassRelation, HttpServletRequest request);

    /**
     * 分页获取用户班级关系封装
     *
     * @param userClassRelationPage
     * @param request
     * @return
     */
    Page<UserClassRelationVO> getUserClassRelationVOPage(Page<UserClassRelation> userClassRelationPage, HttpServletRequest request);

    /**
    * 分按日期分组查询用户班级关系新增数量
    *
    * @param beginDate 开始时间
    * @param endDate   结束时间
    * @return
    */
    List<DataGroupByDateDTO> countByDay(Date beginDate, Date endDate);
}
